﻿namespace Paw.Phone.PivotContent
{
    using System;
    using System.Windows;
    using System.Windows.Controls;
    using Paw.Phone.ViewModel;

    public partial class ListBlobsPage : UserControl
    {
        public ListBlobsPage()
        {
            this.InitializeComponent();
        }

        public event EventHandler<EventArgs> TakePhoto
        {
            add { this.ViewModel.TakePhoto += value; }
            remove { this.ViewModel.TakePhoto -= value; }
        }

        public ListBlobsPageViewModel ViewModel
        {
            get { return this.DataContext as ListBlobsPageViewModel; }
            set { this.DataContext = value; }
        }

        private void OnListBlobs(object sender, RoutedEventArgs e)
        {
            if (this.ViewModel != null)
            {
                this.ViewModel.ListBlobs();
            }
        }
    }
}